<script setup lang="ts">
import "swiper/css";
import "swiper/css/navigation";
import "swiper/css/pagination";
import SwiperCore from "swiper";
import { Swiper, SwiperSlide } from "swiper/vue";
import { Autoplay, Navigation, Pagination } from "swiper/modules";

defineOptions({
  name: "Swiper"
});

SwiperCore.use([Autoplay, Navigation, Pagination]);

const swiperExample = {
  id: 99,
  label: "无限循环",
  options: {
    autoplay: {
      delay: 6000,
      disableOnInteraction: false
    },
    // navigation: true,
    pagination: {
      clickable: true
    },
    loop: true
  }
};
</script>

<template>
  <div class="information-box abs-br-box">
    <h3 class="data-header">漏洞情报</h3>
    <swiper v-bind="swiperExample.options">
      <swiper-slide>
        <div class="flex justify-center items-center h-[230px]">
          <div class="information-slide-title">
            <h1>MinIO权限提升漏洞通告</h1>
            <p>
              近日，MinIO
              官方发布了安全公告，修复了存在的漏洞，漏洞编号：CVE-2024-24747。<br />
              MinIO是一个用Golang开发的基于Apache License
              v2.0开源协议的对象存储服务。MinIO原生支持
              Kubernetes，它可用于每个独立的公共云、每个 Kubernetes 发行版、...
            </p>
          </div>
        </div>
      </swiper-slide>
      <swiper-slide>
        <div class="flex justify-center items-center h-[230px]">
          <div class="information-slide-title">
            <h1>Spring Cloud Contract信息泄露漏洞通告</h1>
            <p>
              近日，Spring发布了安全通告，修复了存在的安全漏洞，漏洞编号：CVE-2024-22236。<br />
              Spring Cloud Contract 为通过CDC（Customer Driven
              Contracts）开发基于JVM的应用提供了支持。它为TDD（测试驱动开发）提供了一种新的测试方式
              - 基于接口。
            </p>
          </div>
        </div>
      </swiper-slide>
      <swiper-slide>
        <div class="flex justify-center items-center h-[230px]">
          <div class="information-slide-title">
            <h1>Ivanti Connect Secure服务器端请求伪造漏洞通告</h1>
            <p>
              近日，Ivanti发布了安全公告，修复了存在的安全漏洞，漏洞编号：CVE-2024-21893。<br />
              Ivanti Pulse Connect Secure（以前称为Pulse
              Secure）是一种虚拟私人网络（VPN）解决方案，由Ivanti公司开发和提供。它旨在为用户提供安全的远程访问和连接到企业网络资源的能力。
            </p>
          </div>
        </div>
      </swiper-slide>
    </swiper>
  </div>
</template>

<style scoped lang="scss">
.abs-br-box {
  padding: 10px;
  background-color: rgba(22, 176, 227, 0.1);
  position: relative;
  &::before {
    content: "";
    display: block;
    width: 5px;
    height: calc(100% + 10px);
    position: absolute;
    top: -5px;
    left: -5px;
    border: 1px solid #506e7b;
    border-right: none;
  }
  &::after {
    content: "";
    display: block;
    width: 5px;
    height: calc(100% + 10px);
    position: absolute;
    top: -5px;
    right: -5px;
    border: 1px solid #506e7b;
    border-left: none;
  }
}

.information-box {
  width: calc(((100% - 500px) / 2));
  height: 100%;
  margin: 10px;
  .data-header {
    font-size: 15px;
    line-height: 15px;
    font-weight: normal;
    color: #2fdbbb;
    padding: 0 10px 10px 0;
  }

  .information-slide-title {
    h1 {
      // font-family: AlibabaPuHuiTiR;
      font-size: 12px;
      color: #fff;
      letter-spacing: 0;
      line-height: 14px;
      margin: 5px 0 10px 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    p {
      font-family: AlibabaPuHuiTiR;
      font-size: 12px;
      color: hsla(0, 0%, 100%, 0.8);
      letter-spacing: 1.2px;
      line-height: 23px;
      height: 135px;
      overflow: hidden;
      display: -webkit-box;
      -webkit-line-clamp: 6;
      -webkit-box-orient: vertical;
    }
  }
}
</style>
